<p>
  <b>Arrive date:</b>
  <%=h @reservation.arrive_date %>
</p>

<p>
  <b>Exit date:</b>
  <%=h @reservation.exit_date %>
</p>

<p>
  <b>Num adults:</b>
  <%=h @reservation.num_adults %>
</p>

<p>
  <b>Num childre:</b>
  <%=h @reservation.num_childre %>
</p>

<p>
  <b>Room:</b>
  <%=h @reservation.room_id %>
</p>

<p>
	<b>Price(per day)</b>
	<%= room = Room.find_by_num(@reservation.room_id)
	roomtype = Roomtype.find_by_name(room.rtype)	
	h roomtype.price %>
	<br>
	<b>Number of days</b>
	<%= number_days = @reservation.exit_date.day - @reservation.arrive_date.day
	if number_days < 0
		number_days = 30 - (number_days * (-1))
	end
	h number_days %>
	<br>
	<b>Total cost</b>	
	<%= 
	room = Room.find_by_num(@reservation.room_id)
	roomtype = Roomtype.find_by_name(room.rtype)	
	number_days = @reservation.exit_date.day - @reservation.arrive_date.day
	if number_days < 0
		number_days = 30 - (number_days * (-1))
	end
	h number_days *  roomtype.price%>
</p>

<p>
  <b>Guest cpf:</b>
  <%=h @reservation.guest_cpf %>
</p>


<%= link_to 'Edit', edit_reservation_path(@reservation) %> |
<%= link_to 'Back', reservations_path %>